package com.enjoyor.soa.traffic.server.efoms.dubbo.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.enjoyor.soa.traffic.api.dto.efoms.DeviceStatusInfoDto;
import com.enjoyor.soa.traffic.api.service.dubbo.efoms.IDubboDevStatusInfoService;
import com.enjoyor.soa.traffic.server.efoms.dubbo.manage.ManageDevStatusInfoService;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;
import org.springframework.beans.factory.annotation.Autowired;

@Service(version = "1.0.0", timeout = 4000)
public class DubboDevStatusInfoService implements IDubboDevStatusInfoService {

    @Autowired
    private ManageDevStatusInfoService manageDevStatusInfoService;
    /**
     * 新增设备状态信息表（关键字段：设备编号、设备名称、设备类别、设备类别名称、设备状态编号、设备装态）
     *
     * @param deviceStatusInfoDto
     * @param username
     * @return
     */
    @Override
    public ResultPojo insertDevStatusInfo(DeviceStatusInfoDto deviceStatusInfoDto, String username) {
        return manageDevStatusInfoService.insertDevStatusInfo(deviceStatusInfoDto,username);
    }

    /**
     * 修改设备状态信息表（关键字段：设备类别、设备Id、状态信息）
     *
     * @param deviceStatusInfoDto
     * @param username
     * @return
     */
    @Override
    public ResultPojo updateDevStatusInfo(DeviceStatusInfoDto deviceStatusInfoDto, String username) {
        return manageDevStatusInfoService.updateDevStatusInfo(deviceStatusInfoDto,username);
    }

    /**
     * 获取设备状态信息
     * @param devCategoryCode 设备类别编号
     * @param devTypeCode 设备类型编号
     * @param devId     设备编号
     * @return
     */
    @Override
    public ResultPojo getDevStatusInfo(String devCategoryCode, String devTypeCode, String devId) {
        return manageDevStatusInfoService.getDevStatusInfo(devCategoryCode, devTypeCode,devId);
    }

    /**
     * 获取设备状态信息
     * @param devStatusId
     * @return
     */
    @Override
    public ResultPojo getDevStatusInfoById(String devStatusId) {
        return manageDevStatusInfoService.getDevStatusInfoById(devStatusId);
    }
}
